package com.yex.utils.vo;


import java.io.Serializable;

public class RespInfo implements Serializable{

	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7214947582952406893L;
	private String code;
	private String msg;
	private Object data;
	private boolean flag;
	
	public static final RespInfo SUCCESS = new RespInfo(RespCode.SUCCESS);
	public static final RespInfo NOT_MATH = new RespInfo(RespCode.NOT_MATH);
	public static final RespInfo FAILURE = new RespInfo(RespCode.FAILURE);
	public static final RespInfo MEMORY_FAIL = new RespInfo(RespCode.MEMORY_FAIL);
	public static final RespInfo NOT_ENOUGH_COUNT = new RespInfo(RespCode.NOT_ENOUGH_COUNT);
	public static final RespInfo NOT_ENOUGH_AMOUT = new RespInfo(RespCode.NOT_ENOUGH_AMOUT);
	public static final RespInfo ENOUGH_COUNT = new RespInfo(RespCode.ENOUGH_COUNT);
	public static final RespInfo ENOUGH_AMOUT = new RespInfo(RespCode.ENOUGH_AMOUT);
	public static final RespInfo PRECISION_COUNT = new RespInfo(RespCode.PRECISION_COUNT);
	public static final RespInfo PRECISION_AMOUT = new RespInfo(RespCode.PRECISION_AMOUT);
	public static final RespInfo NOT_TRADE = new RespInfo(RespCode.NOT_TRADE);
	public static final RespInfo MIN_PRICE = new RespInfo(RespCode.MIN_PRICE);
	public static final RespInfo MAX_PRICE = new RespInfo(RespCode.MAX_PRICE);

	
	public RespInfo(RespCode respCode) {
		
		super();
		this.code = respCode.getCode();
		this.msg = respCode.getMsg();
		if("0000".equals(respCode.getCode())) {
			this.flag = true;
		}else {
			this.flag = false;
		}
	}
	
	public RespInfo(RespCode respCode, Object data) {
		
		super();
		this.code = respCode.getCode();
		this.msg = respCode.getMsg();
		this.data = data;
		if("0000".equals(respCode.getCode())) {
			this.flag = true;
		}else {
			this.flag = false;
		}
	}

	public RespInfo(RespCode respCode, String msg, Object data) {
		super();
		this.code = respCode.getCode();
		this.msg =msg;
		this.data = data;
		if("0000".equals(respCode.getCode())) {
			this.flag = true;
		}else {
			this.flag = false;
		}
	}

	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	
	public boolean isSuccess() {

		return flag;
	}
	public Object getData() {
		return data;
	}
	public void setData(Object data) {
		this.data = data;
	}



	
	
	
}
